
package com.tempo.defaul;

import com.tempo.point.PointAbs;
import com.tempo.point.PointDms;
import com.tempo.point.PointLambert;
import com.tempo.point.PointUtm;
import com.tempo.projection.PrjAbs;
import com.tempo.projection.conical.PrjConAbs;
import com.tempo.projection.conical.PrjConLambert1972;
import com.tempo.projection.conical.PrjConLambert2008;
import com.tempo.projection.conical.PrjConLambert93;
import com.tempo.projection.conical.PrjConLambertMexico;
import com.tempo.projection.cylindrical.PrjCylAbs;
import com.tempo.projection.cylindrical.PrjCylUtm;
import com.tempo.utils.UtilsConicalConvert;
import com.tempo.utils.UtilsCylindricalConvert;


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author user
 */
public class Test
{
   public static void main(String[] args) throws Exception
   {
      TestConversion[] tests = 
      {
         new TestConversion(
              "PrjConLambert93",
              new PointDms(10, 40),
              new PointLambert(1300132.2440885678, 5903651.94441981),
              PrjConLambert93.s_getInstance()),
         new TestConversion(
              "3812_PrjConLambert2008",
              new PointDms(10, 40),
              new PointLambert(1138158.9936737407, -522382.3696528121),
              PrjConLambert2008.s_getInstance()),
         new TestConversion(
              "SR39_PrjConLambertMexican",
              new PointDms(-80.83594322203, 7.916019558907),
              new PointLambert(4897414.312483, -284576.20796),
              PrjConLambertMexico.s_getInstance()),
         new TestConversion(
              "SR39_PrjConLambert1972",
              new PointDms(10, 40),
              new PointLambert(639153.261772, -1022369.266852),
              PrjConLambert1972.s_getInstance()),
         
        new TestConversion(
              "UTM_36T",
              new PointDms(10, 55),
              new PointLambert(563967.423103, 6095248.70824),
              PrjCylUtm.s_getInstance())
      };
      
      
            StopWatch.start();
      /*/
      for(int i = 0; i < tests.length; i++)
      {
         PointAbs input = tests[i].getPointInput();
         PrjAbs prj = tests[i].getProjection();
         
         
         if(input instanceof PointDms && prj instanceof PrjConAbs)//Dms -> conical, Big precision
         {
            PointLambert found = UtilConicalConvert.dmsToConBigPrecision((PointDms)input, (PrjConAbs)prj);
            tests[i].setPointFound(found);


            PointDms crossVal = UtilConicalConvert.conToDmsBigPrecision(found, (PrjConAbs)prj);
            tests[i].setCrossVal(crossVal);
         }
         
         /*/
            /*

         
         tests[i].show();
      }
      
      //*/
      for(int i = 0; i <  tests.length; i++)
      {
         PointAbs input = tests[i].getPointInput();
         PrjAbs prj = tests[i].getProjection();
         
         
         if(input instanceof PointDms && prj instanceof PrjConAbs)//Dms -> conical, Big precision
         {
            PointLambert found = UtilsConicalConvert.dmsToCon((PointDms)input, (PrjConAbs)prj);
            tests[i].setPointFound(found);


            PointDms crossVal = UtilsConicalConvert.conToDms(found, (PrjConAbs)prj);
            tests[i].setCrossVal(crossVal);
         }
         
         if(input instanceof PointDms && prj instanceof PrjCylAbs)//Dms -> cylindrical, Big precision
         {
            PointUtm found = UtilsCylindricalConvert.dmsToUtm_wiki(
                    (PointDms)input,
                    (PrjCylAbs) prj);
            tests[i].setPointFound(found);
            
            System.out.println(found.getZoneNumber() + found.getZoneLetter());


            PointDms crossVal = UtilsCylindricalConvert.utmToDms(found, (PrjCylAbs)prj);
            tests[i].setCrossVal(crossVal);
         }
         tests[i].show();
      }
      //*/
      System.out.println(StopWatch.end("end chrono"));
   }
   
   
}  
